﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KadalaSpree.XCore
{
    public static class XLookup
    {
        public static class Elements
        {
            private static Dictionary<ElementName, ulong> _elementNameAndHash = new Dictionary<ElementName, ulong>();
            public static Dictionary<ElementName, ulong> ElementNameAndHash
            {
                get
                {                                  
                    if (!_elementNameAndHash.Any())
                    {
                        X.Logger.Instance.Log("Merging Element Dictionaries");
                        _elementNameAndHash = _elementNameAndHash.Merge(new IDictionary<ElementName, ulong>[]
                        {
                            Vendors.JewelerElementNameAndHash,
                            Vendors.VendorWindowNameAndHash
                        });                        
                    }
                    return _elementNameAndHash;
                }
            }

            public class Vendors
            {
                public static Dictionary<ElementName, ulong> JewelerElementNameAndHash = new Dictionary<ElementName, ulong>
                {
                    {ElementName.EmeraldFlawlessRoyal,0x7309E93341776EAB}, 
                    {ElementName.EmeraldRoyal,0xE7AD461F1EE2BAE6}, 
                    {ElementName.EmeraldFlawlessImperial,0x6E8BD305F4A6E339}, 
                    {ElementName.EmeraldImperial,0x3A3FF505F92057A4}, 
                    {ElementName.TopazFlawlessRoyal,0x13B11F86EACFDF91}, 
                    {ElementName.TopazRoyal,0x7C68B63DF094BEFC}, 
                    {ElementName.TopazFlawlessImperial,0xA6E5C8805D48B71B}, 
                    {ElementName.TopazImperial,0xC01BED64BEBFDD56}, 
                    {ElementName.AmethystFlawlessRoyal,0x3A79DC234A3AE772}, 
                    {ElementName.AmethystRoyal,0x5D47C4EFDCD53397}, 
                    {ElementName.AmethystFlawlessImperial,0xDCBCD2CE8DBD4AAC}, 
                    {ElementName.AmethystImperial,0x69B51992BC9A4F01},
                    {ElementName.RubyFlawlessRoyal,0x41BA296EABEA867E}, 
                    {ElementName.RubyRoyal,0xC7ABFD4C151C4F63}, 
                    {ElementName.RubyFlawlessImperial,0x3D075D3069446B68}, 
                    {ElementName.RubyImperial,0xDA7DFE85C8871F9D},  
                    {ElementName.DiamondFlawlessRoyal,0x7666352AA35A5868}, 
                    {ElementName.DiamondRoyal,0x13DCD680029D0C9D}, 
                    {ElementName.DiamondFlawlessImperial,0x98875A51E6838511}, 
                    {ElementName.DiamondImperial,0x13EF108EC48647C}, 
                };     
  
                public static Dictionary<ElementName, ulong> VendorWindowNameAndHash = new Dictionary<ElementName, ulong>
                {
                    {ElementName.MysteryVendorWindow,0xA83F2BC15AC524D7}, 
                };    
         
                
            }
        }

        public static class Actors
        {
            private static Dictionary<ActorName, int> _actorNameAndId = new Dictionary<ActorName, int>();
            public static Dictionary<ActorName, int> ActorNameAndId {                 
                get
                {
                    if (!_actorNameAndId.Any())
                    {
                        X.Logger.Instance.Log("Merging Actor Dictionaries");
                        _actorNameAndId = _actorNameAndId.Merge(new IDictionary<ActorName, int>[]
                        {
                            Npc.ActorNameId,
                            Gizmo.ActorNameId
                        });                        
                    }
                    return _actorNameAndId;
                }
            }

            public static class Npc
            {
                public static Dictionary<ActorName, int> ActorNameId = new Dictionary<ActorName, int>()
                {
                    { ActorName.Kadala,361241 },
                    { ActorName.Orek,363744 },
                    { ActorName.Blacksmith, 195172 },    // Shortcut=195170 NPC=56947 // SalvageSC 195170
                    { ActorName.Mystic,212510 },        // Shortcut=212510 NPC=56948
                    { ActorName.Jeweler, 212519},       // Shortcut=212519 NPC=56949
                    { ActorName.Enchantress,4062 },  
                    { ActorName.Templar,4538 },
                    { ActorName.Scoundrel,4644 },
                    { ActorName.Fence,182389 },
                    { ActorName.Miner,182390 },
                    { ActorName.Collector,181466 },  
                    { ActorName.Tyrael,114622 }
                };
            }

            public static class Gizmo
            {
                public static Dictionary<ActorName, int> ActorNameId = new Dictionary<ActorName, int>()
                {
                    { ActorName.Waypoint,6442 },
                    { ActorName.NephalemObelisk,364715 },   
                    { ActorName.Stash,130400 },   
                    { ActorName.HearthPortal, 191492 },
                    { ActorName.BookofCain, 295415 }                       
                };
            }

            public static class Vendors
            {

                public static Dictionary<VendorSlotType, int> MysterySlotTypeAndId = new Dictionary<VendorSlotType, int>
                {
                    {VendorSlotType.OneHandItem,377355}, 
                    {VendorSlotType.TwoHandItem,377356}, 
                    {VendorSlotType.Quiver,377360}, 
                    {VendorSlotType.Orb,377358}, 
                    {VendorSlotType.Mojo,377359}, 
                    {VendorSlotType.Helm,377344}, 
                    {VendorSlotType.Gloves,377346}, 
                    {VendorSlotType.Boots,377347}, 
                    {VendorSlotType.Chest,377345}, 
                    {VendorSlotType.Belt,377349}, 
                    {VendorSlotType.Pants,377350}, 
                    {VendorSlotType.Bracers,377351}, 
                    {VendorSlotType.Shield,377357}, 
                    {VendorSlotType.Ring,377352}, 
                    {VendorSlotType.Amulet,377353},
                    {VendorSlotType.Shoulder,377348}
                    
                };

                public static Dictionary<VendorSlotType, int> MysterySlotTypeAndPrice = new Dictionary<VendorSlotType, int>
                {
                    //{VendorSlotType.OneHandItem,15}, 
                    //{VendorSlotType.TwoHandItem,15}, 
                    //{VendorSlotType.Quiver,5}, 
                    //{VendorSlotType.Orb,5}, 
                    //{VendorSlotType.Mojo,5}, 
                    //{VendorSlotType.Helm,5}, 
                    //{VendorSlotType.Gloves,5}, 
                    //{VendorSlotType.Boots,5}, 
                    //{VendorSlotType.Chest,5}, 
                    //{VendorSlotType.Belt,5}, 
                    //{VendorSlotType.Pants,5}, 
                    //{VendorSlotType.Bracers,5}, 
                    //{VendorSlotType.Shield,5}, 
                    //{VendorSlotType.Ring,10}, 
                    //{VendorSlotType.Amulet,20}               
                    {VendorSlotType.OneHandItem,75}, 
                    {VendorSlotType.TwoHandItem,75}, 
                    {VendorSlotType.Quiver,25}, 
                    {VendorSlotType.Orb,25}, 
                    {VendorSlotType.Mojo,25}, 
                    {VendorSlotType.Helm,25}, 
                    {VendorSlotType.Gloves,25}, 
                    {VendorSlotType.Boots,25}, 
                    {VendorSlotType.Chest,25}, 
                    {VendorSlotType.Belt,25}, 
                    {VendorSlotType.Pants,25}, 
                    {VendorSlotType.Bracers,25}, 
                    {VendorSlotType.Shield,25}, 
                    {VendorSlotType.Ring,50}, 
                    {VendorSlotType.Amulet,100}
                
                };

                public static Dictionary<GemQuality, int> GemCombineQualityAndPrice = new Dictionary<GemQuality, int>
                {
                    {GemQuality.FlawlessRoyal, 500000},
                    {GemQuality.Royal, 400000},
                    {GemQuality.FlawlessImperial, 300000},
                    {GemQuality.Imperial, 200000},
                    {GemQuality.Marquis, 100000},
                    {GemQuality.RadiantStar, 75000},
                    {GemQuality.PerfectStar, 50000},
                    {GemQuality.FlawlessStar, 30000},
                    {GemQuality.Star, 20000},
                    {GemQuality.RadiantSquare, 10000},
                    {GemQuality.PerfectSquare, 5000},
                    {GemQuality.FlawlessSquare, 100},
                    {GemQuality.Square, 85},
                    {GemQuality.Radiant, 70},
                    {GemQuality.Perfect, 55},
                    {GemQuality.Flawless, 40},
                    {GemQuality.Normal, 25},
                    {GemQuality.Flawed, 10}
                };

            }
        }

    }

}
